/*
 * @Author: yangzonglong
 * @Date: 2020-09-23 13:13:57
 * @version: v1.0.0
 * @Descripttion:
 * @LastEditors: yangzonglong
 * @LastEditTime: 2020-09-24 16:18:33
 * @Auditor:
 */
import { server, message } from './../../utils';

export async function getListApi(url: string, businessId: string) {
  try {
    const { rows } = await server(url, { where: { businessId } });
    return rows;
  } catch (error) {
    return [];
  }
}

export async function addCommitApi(url: string, businessId: string, comment: string) {
  try {
    const result = await server(url, { data: { businessId, comment } });
    message.success();
    return result;
  } catch (error) {
    message.error();
    return {};
  }
}
